@ECHO OFF
TITLE Making Jar...

REM *
REM * SET YOUR VARIABLES HERE 
REM *

SET CLASSFOLDER=bin
SET JARFOLDER=dist
SET LIBSFOLDER=lib

SET MAINCLASS=br.com.grimoire.calc.CalcFrame
SET MY_JAR=jMSCalc
SET MY_CLASSPATH=br\com\grimoire\calc

SET EXT_JAR1=grouplayout
SET EXT_CLASSPATH1=org\dyno\visual\swing\layouts

REM *
REM * SCRIPT STARTS
REM *

CLS
CD .\%CLASSFOLDER%
ECHO Main-Class: %MAINCLASS%>>MANIFEST.MF
jar xf ..\%LIBSFOLDER%\%EXT_JAR1%.jar
jar cmfv MANIFEST.MF %MY_JAR%.jar %MY_CLASSPATH%\*.class %EXT_CLASSPATH1%\*.class
DEL MANIFEST.MF
CD ..
IF EXIST %JARFOLDER% GOTO END
MD .\%JARFOLDER%
:END
MOVE .\%CLASSFOLDER%\%MY_JAR%.jar .\%JARFOLDER%
PAUSE